import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'flutter_kuafood_camera_platform_interface.dart';

/// An implementation of [FlutterKuafoodCameraPlatform] that uses method channels.
class MethodChannelFlutterKuafoodCamera extends FlutterKuafoodCameraPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('com.kuafood.kms.android/camera');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }


  @override
  Future beginRecordVideo() async {
    return await methodChannel.invokeMethod('beginRecordVideo');
  }

  @override
  Future<String?> endRecordVideo() async{
    return await methodChannel.invokeMethod('endRecordVideo');
  }

  @override
  Future<void> switchFrontCamera()  {

    return  methodChannel.invokeMethod('switchFrontCamera');
  }

  @override
  Future switchBackCamera() {
   return methodChannel.invokeMethod('switchBackCamera');
  }


  @override
  Future<void> closeFlashLight() {
    // TODO: implement closeFlashLight
    return methodChannel.invokeMethod('closeFlashLight');
  }

  @override
  Future<void> openFlashLight() {
    // TODO: implement openFlashLight
    return methodChannel.invokeMethod("openFlashLight");
  }
}
